<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="shortcut icon" th:href="@{/resources/favicon.ico}"/>
</head>
<body>
<h1>Create item</h1>

<form action="#" th:action="@{/list/add}" th:object="${item}" method="post">
    <div th:if="${#fields.hasGlobalErrors()}">
        <p th:each="err : ${#fields.globalErrors()}" th:text="${err}">Validation error</p>
    </div>
    <input type="text" th:field="*{title}"/>

    <p th:if="${#fields.hasErrors('title')}" th:errors="*{title}">Field validation error</p>
    <input type="submit" value="Create"/>
</form>

</body>
</html>